<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var classArray =[{id:"9",name:"J179"},
                        {id:"2",name:"J180"},
                        {id:"3",name:"J181"},];
        window.onload = function () {
            var classBox = document.getElementById("classCheck");
            var str = "";
            for(var i=0;i<classArray.length;i++){
                var classObj = classArray[i];
                str += "<option value='"+classObj.id+"'>"+classObj.name+"</option>";
            }
            classBox.innerHTML=str;
            alert(classBox.value);
        }

    </script>
</head>
<body>
<form action="add" method="get">
    <select id="classCheck">
    </select>
    <input type="submit" value="提交">

</form>

</body>
</html>